home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1989 January / Ahoy_Magazine_89-01_1989_Double_L.d64 / Team Play (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  778b  |  34 lines

  1. 0 print"[147]               team play":print
  2. 1 rem ==================================
  3. 2 rem    commodares problem #57-2 :
  4. 3 rem       team play
  5. 4 rem    solution by
  6. 5 rem       fred ransom
  7. 6 rem ==================================
  8. 10 input "number of teams";n
  9. 20 dim t$(n): print"give team names:"
  10. 30 for k=0 to n-1
  11. 40 print"team number ";k+1;: input t$(k)
  12. 50 next k
  13. 55 if (n and 1) then n=n+1:t$(n-1)="---"
  14. 60 input "to (p)rinter or (s)creen [s]";fl$
  15. 70 dev=3 : if fl$="p" then dev=4
  16. 80 open 4,dev
  17. 90 for j=1 to n-1
  18. 100 for a=1 to 3 : print#4 : next
  19. 110 print#4,"round ";j
  20. 120 print#4,"home", "away"
  21. 130 print#4,"======", "======"
  22. 140 for k=0 to (n/2-1)
  23. 150 if (j and 1)=1 then print#4, t$(k), t$(k+n/2)
  24. 160 if (j and 1)=0 then print#4, t$(k + n/2), t$(k)
  25. 170 next k
  26. 180 a$=t$(1)
  27. 190 if n < 3 then 240
  28. 200 for k=2 to n-1
  29. 210 t$(k-1)=t$(k)
  30. 220 next k
  31. 230 t$(n-1)=a$
  32. 240 next j
  33. 250 close 4
  34.